package czopyk.model.persistence.actions;

import czopyk.model.persistence.ValueExtractor;
import czopyk.model.structure.Modulator;

public class ChangeHitRateAction extends CommonAction implements Action {

	private final String center, value;

	public ChangeHitRateAction(String center, String value, Modulator mod, ValueExtractor ve) {
		super(mod, ve);
		this.mod = mod;
		if (center == null) {
			throw new IllegalArgumentException(
					"CenterName cannot be null at change hitRate action.");
		}
		this.center = center;
		this.value = value;
	}

	public void perform() {
		mod.setHitRateInCenter(center, Double.parseDouble(ve.getValue(value)));
	}
	
}
